home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
gsdbloo.exe
/
GS_KEYI.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-02-24
|
21KB
|
460 lines
unit GS_KeyI;
{-----------------------------------------------------------------------------
Keyboard Input Routines
GS_KeyI Copyright (c) Richard F. Griffin
9 April 1990
102 Molded Stone Pl
Warner Robins, GA 31088
-------------------------------------------------------------
This unit handles the objects for all keyboard data entry
operations.
Changes:
02 Jun 91 - Made EditString a virtual method.
20 Feb 92 - Added Done destructor for consistency to ensure a
Done destructor exists for dynamic deallocation.
Added GSP_KeyI_Object as a pointer for dynamic
allocation.
------------------------------------------------------------------------------}
interface
{$D-}
uses
CRT, DOS, GS_Scrn;
const
BeepTime = 200;
BeepFreq = 600;
Kbd_Null = #0; {Null Character}
Kbd_Nul = #3; {Another Null}
Kbd_Bsp = #8; {Backspace}
Kbd_Tab = #9; {Tab}
Kbd_Ret = #13; {Return}
Kbd_RTb = #15; {Shift-Tab}
Kbd_AlQ = #16; {Alt-Q}
Kbd_AlW = #17; {Alt-W}
Kbd_AlE = #18; {Alt-E}
Kbd_AlR = #19; {Alt-R}
Kbd_AlT = #20; {Alt-T}
Kbd_AlY = #21; {Alt-Y}
Kbd_AlU = #22; {Alt-U}
Kbd_AlI = #23; {Alt-I}
Kbd_AlO = #24; {Alt-O}
Kbd_AlP = #25; {Alt-P}
Kbd_Esc = #27; {Escape}
Kbd_AlA = #30; {Alt-A}
Kbd_AlS = #31; {Alt-S}
Kbd_AlD = #32; {Alt-D}
Kbd_AlF = #33; {Alt-F}
Kbd_AlG = #34; {Alt-G}
Kbd_AlH = #35; {Alt-H}
Kbd_AlJ = #36; {Alt-J}
Kbd_AlK = #37; {Alt-K}
Kbd_AlL = #38; {Alt-L}
Kbd_AlZ = #44; {Alt-Z}
Kbd_AlX = #45; {Alt-X}
Kbd_AlC = #46; {Alt-C}
Kbd_AlV = #47; {Alt-V}
Kbd_AlB = #48; {Alt-B}
Kbd_AlN = #49; {Alt-N}
Kbd_AlM = #50; {Alt-M}
Kbd_F1 = #59; {F1}
Kbd_F2 = #60; {F2}
Kbd_F3 = #61; {F3}
Kbd_F4 = #62; {F4}
Kbd_F5 = #63; {F5}
Kbd_F6 = #64; {F6}
Kbd_F7 = #65; {F7}
Kbd_F8 = #66; {F8}
Kbd_F9 = #67; {F9}
Kbd_F10 = #68; {F10}
Kbd_Home = #71; {Home}
Kbd_UpAr = #72; {Up Arrow}
Kbd_PgUp = #73; {Page Up}
Kbd_LfAr = #75; {Left Arrow}
Kbd_RtAr = #77; {Right Arrow}
Kbd_End = #79; {End}
Kbd_DnAr = #80; {Down Arrow}
Kbd_PgDn = #81; {Page Down}
Kbd_Ins = #82; {Insert}
Kbd_Del = #83; {Delete}
Kbd_F11 = #84; {Shift-F1}
Kbd_F12 = #85; {Shift-F2}
Kbd_F13 = #86; {Shift-F3}
Kbd_F14 = #87; {Shift-F4}
Kbd_F15 = #88; {Shift-F5}
Kbd_F16 = #89; {Shift-F6}
Kbd_F17 = #90; {Shift-F7}
Kbd_F18 = #91; {Shift-F8}
Kbd_F19 = #92; {Shift-F9}
Kbd_F20 = #93; {Shift-F10}
Kbd_F21 = #94; {Ctrl-F1}
Kbd_F22 = #95; {Ctrl-F2}
Kbd_F23 = #96; {Ctrl-F3}
Kbd_F24 = #97; {Ctrl-F4}
Kbd_F25 = #98; {Ctrl-F5}
Kbd_F26 = #99; {Ctrl-F6}
Kbd_F27 = #100; {Ctrl-F7}
Kbd_F28 = #101; {Ctrl-F8}
Kbd_F29 = #102; {Ctrl-F9}
Kbd_F30 = #103; {Ctrl-F10}
Kbd_F31 = #104; {Alt-F1}
Kbd_F32 = #105; {Alt-F2}
Kbd_F33 = #106; {Alt-F3}
Kbd_F34 = #107; {Alt-F4}
Kbd_F35 = #108; {Alt-F5}
Kbd_F36 = #109; {Alt-F6}
Kbd_F37 = #110; {Alt-F7}
Kbd_F38 = #111; {Alt-F8}
Kbd_F39 = #112; {Alt-F9}
Kbd_F40 = #113; {Alt-F10}
Kbd_CPSc = #114; {Ctrl-PrtSc}
Kbd_CLAr = #115; {Ctrl-Left Arrow}
Kbd_CRAr = #116; {Ctrl-Right Arrow}
Kbd_CEnd = #117; {Ctrl-End}
Kbd_CPDn = #118; {Ctrl-Page Down}
Kbd_CHom = #119; {Ctrl-Home}
Kbd_Al1 = #120; {Alt-1}
Kbd_Al2 = #121; {Alt-2}
Kbd_Al3 = #122; {Alt-3}
Kbd_Al4 = #123; {Alt-4}
Kbd_Al5 = #124; {Alt-5}
Kbd_Al6 = #125; {Alt-6}
Kbd_Al7 = #126; {Alt-7}
Kbd_Al8 = #127; {Alt-8}
Kbd_Al9 = #128; {Alt-9}
Kbd_Al0 = #129; {Alt-0}
Kbd_AlHy = #130; {Alt-Hyphen}
Kbd_AlEq = #131; {Alt-Equal}
Kbd_CPUp = #132; {Ctrl-Page up}
type
{
┌──────────────────────────────────────────────────────────┐
│ ******** Object for Keyboard Entry Action ******* │
│ │
│ This object type describes the structure for any child │
│ so that the child object can use a virtual method to │
│ handle processing of function keys. │
└──────────────────────────────────────────────────────────┘
}
GSP_KeyI_Objt = ^GS_KeyI_Objt;
GS_KeyI_Objt = Object
CPos : Word;
{Holds the position within the string}
Ch : Char;
{Holds the last character read}
First : boolean;
{Flag to detect the first real character}
{entered from the keyboard}
Modified : boolean;
{Flag to signal whether the field was}
{mofified, or the default was returned}
Wait_CR : boolean;
{Flag to wait for Carriage Return before}
{exit. If false, will exit when the}
{field is full}
constructor Init;
destructor Done;
function EditString(T : string; x, y, l : integer)
: string; virtual;
procedure Check_Func_Keys; virtual;
{Note this method is virtual, so it may}
{be replaced by any child method for its}
{own processing of function key actions}
end;
var
GS_KeyI_Esc,
GS_KeyI_Fuc,
GS_KeyI_Ins,
GS_KeyI_Ret : boolean;
GS_KeyI_Chr : char;
GS_KeyI_Str : string[255];
Function GS_KeyI_GetKey : char; {Any program can call this to read a}
{character and test for function keys}